.PHONY: clean
MACHINE = OSX
EXEC = BA2
LIBS = -lgsl -lgslcblas -lm
EXEC = BA2
CPP = g++
UNIXFLAGS = -static -Wall -O2
OSXFLAGS = -Wall -O4

ifeq "$(MACHINE)" "OSX"
	FLAGS = $(OSXFLAGS)
endif
ifeq "$(MACHINE)" "UNIX"
	FLAGS = $(UNIXFLAGS)
endif
ifeq "$(TESTING)" "PROFILE"
	LIBD = -pg
endif


BA2: BA2.o BA2DataFuncs.o BA2BayesAss.o BA2Simulate.o
	$(CPP) $(FLAGS) BA2.o BA2DataFuncs.o BA2BayesAss.o BA2Simulate.o $(LIBS) $(LIBD) -o $(EXEC)
BA2.o: BA2.cpp BA2.h
	$(CPP) $(FLAGS) -c BA2.cpp $(LIBD)
BA2DataFuncs.o: BA2DataFuncs.cpp BA2.h
	$(CPP) $(FLAGS) -c BA2DataFuncs.cpp $(LIBD)
BA2BayesAss.o: BA2BayesAss.cpp BA2.h
	$(CPP) $(FLAGS) -c BA2BayesAss.cpp $(LIBD)
BA2Simulate.o: BA2Simulate.cpp BA2.h
	$(CPP) $(FLAGS) -c BA2Simulate.cpp $(LIBD)
clean:
	rm -f *.o
